-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document and follow aliases better #414
Conversation
…l alias. An module-level alias must be defined at the top level of the module.
…fs blocks. Add a test for that.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #414 +/- ##
==========================================
- Coverage 92.31% 92.20% -0.11%
==========================================
Files 45 46 +1
Lines 7959 8095 +136
Branches 1736 1767 +31
==========================================
+ Hits 7347 7464 +117
- Misses 356 370 +14
- Partials 256 261 +5 ☔ View full report in Codecov by Sentry. |
…computing it from AST all the time. Consider variables that are not on the root level as aliases, too. And warns only when they are actually overriden. Move node2fullname to astutils module. Delete overridenInCount from ClassPage since it was unused. Re-export names that are not part of the current system with an alias. Cleanup expandName() and associated. Use directly taglink() in format_alias_value() when possible. Add Documentable.aliases property. This is somewhat working in the tests but not always in real life. Rename the redirected_from parameter to "indirections". Speaking of tests, this commit also adds A LOT of new tests for the expandName() method.
…astbuilder tests, mostly related to alias handling... I'll fix that after merging.
Should undocumented aliases be shown in output ? I current implementation does, maybe we should think about it twice, because it cause create a lot of noise in the docs. |
def one(item: str) -> "Flattenable": | ||
r: List['Flattenable'] = [] | ||
for i, item in enumerate(lst): | ||
if i>0: | ||
r.append(', ') | ||
if item in system.allobjects: | ||
return tags.code(epydoc2stan.taglink(system.allobjects[item], page_url)) | ||
r.append(tags.code(epydoc2stan.taglink(system.allobjects[item], page_url))) | ||
else: | ||
return item | ||
def commasep(items: Sequence[str]) -> List["Flattenable"]: | ||
r = [] | ||
for item in items: | ||
r.append(one(item)) | ||
r.append(', ') | ||
del r[-1] | ||
return r | ||
r.append(tags.code(item)) | ||
p: List["Flattenable"] = [label] | ||
p.extend(commasep(lst)) | ||
p.extend(r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change necessary ?
…d to _localNameToFullName() function.)
…he inventory. Goes much faster to test locally.
Add aliases to the output and add them in the system with a special kind:
ALIAS
.This PR introduces major changes in the manner Documentable.expandName() processes the aliases.
Since we are now creating legit documentable object for every alias, the expandName() has to follow them.
See #313 for details.
TODO: